Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dns-txt

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-txt

Encode/decode DNS-SD TXT record RDATA fields

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is dns-txt?

The dns-txt npm package is used to encode and decode DNS TXT records. TXT records are often used to hold descriptive text and machine-readable data within DNS (Domain Name System). The dns-txt package provides a straightforward API for handling these records, making it easier to work with them in Node.js applications.

What are dns-txt's main functionalities?

Encoding TXT records

This feature allows you to encode JavaScript objects into TXT record formats. The `encode` method takes an object and returns a buffer that represents the TXT record, which can be used in DNS settings.

const txt = require('dns-txt')();
const encoded = txt.encode({key: 'value'});
console.log(encoded); // Output will be a buffer representing the TXT record

Decoding TXT records

This feature enables the decoding of TXT records back into JavaScript objects. The `decode` method takes a buffer that represents the TXT record and returns an object with the data extracted from the record.

const txt = require('dns-txt')();
const decoded = txt.decode(Buffer.from('key=value'));
console.log(decoded); // Output will be an object { key: 'value' }

Other packages similar to dns-txt

Keywords

FAQs

Package last updated on 24 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc